using System;
using System.Collections.Generic;
using System.Text;
using ESBSimpleSamples.ServiceClient.Enums;
using ESBSimpleSamples.ServiceClient.Helpers;

namespace ESBSimpleSamples.ServiceClient.Itineraries
{
    public class ItineraryService
    {
        #region Private instance fields

        private List<ResolverConnection> _resolvers = new List<ResolverConnection>();
        private string _name;
        private ServiceState _state = ServiceState.Pending;
        private ServiceType _type;
        private ServiceName _knownName;
        private int _position = 0;

        #endregion

        #region Public properties

        public List<ResolverConnection> Resolvers
        {
            get { return _resolvers; }
            set { _resolvers = value; }
        }

        public string ServiceName
        {
            get { return _name; }
            set { _name = value; }
        }

        public ServiceName KnownServiceName
        {
            get { return _knownName; }
            set { _knownName = value; }
        }

        public ServiceState State
        {
            get { return _state; }
            set { _state = value; }
        }

        public ServiceType Type
        {
            get { return _type; }
            set { _type = value; }
        }

        public int Position
        {
            get { return _position; }
            set { _position = value; }
        }

        #endregion

        #region Constructors

        /// <summary>
        /// Default constructor
        /// </summary>
        public ItineraryService() { }

        /// <summary>
        /// Constructor for known service types
        /// </summary>
        /// <param name="serviceName"></param>
        /// <param name="serviceType"></param>
        public ItineraryService(ServiceName serviceName, ServiceType serviceType)
        {
            this._knownName = serviceName;
            this._name = EnumHelper.GetCode(serviceName);
            this._type = serviceType;
        }

        /// <summary>
        /// Constructor for custom service types
        /// </summary>
        /// <param name="customServiceName"></param>
        /// <param name="serviceType"></param>
        public ItineraryService(string customServiceName, ServiceType serviceType)
        {
            this._name = customServiceName;
            this._type = serviceType;
        }

        #endregion

    }
}
